﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace SocketProject
{
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
            //Get   the   running   instance.   

            Process instance = Common.AppInstance.RunningInstance(Assembly.GetExecutingAssembly().Location.Replace("/", "\\"));
            if (instance == null)
            {
                System.Windows.Forms.Application.EnableVisualStyles();  
                System.Windows.Forms.Application.DoEvents();
                //There   isn't   another   instance,   show   our   form.   
                System.Windows.Forms.Application.Run(new FrmServer());
            }
            else
            {
                //There   is   another   instance   of   this   process.   
                Common.AppInstance.HandleRunningInstance(instance);
            }
        }
    }
}
